<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>管理员管理页</title>
  <!-- Bootstrap Styles-->
  <link href="__STATIC__/assest/css/bootstrap.css" rel="stylesheet" />
  <!-- FontAwesome Styles-->
  <link href="__STATIC__/assest/css/font-awesome.css" rel="stylesheet" />
  <!-- Morris Chart Styles-->

  <!-- Custom Styles-->
  <link href="__STATIC__/assest/css/custom-styles.css" rel="stylesheet" />
  <!-- Google Fonts-->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css" />
  <!-- TABLE STYLES-->
  <link href="__STATIC__/assest/js/dataTables.bootstrap.css" rel="stylesheet" />
</head>
<body>
<div id="wrapper">
  {include    file="public:nav1"   /}
  {include    file="public:nav"   /}
  <!-- /. NAV SIDE  -->
  <div id="page-wrapper" >
    <div class="header">
      <h1 class="page-header">
        物品管理
      </h1>
      <ol class="breadcrumb">
        <li><a href="#">物品管理</a></li>
        <li><a href="#">香水</a></li>
      </ol>

    </div>

    <div id="page-inner">

      <div class="widget widget-padding span12">
        <div class="widget-header">
          <i class="icon-group"></i>
          <h5>视频列表</h5>
          <div class="widget-buttons">
            <a href="#" data-title="Add User" data-toggle="modal" data-target="#example_modal"><i class="icon-plus"></i></a>
            <a href="#" data-title="Collapse" data-collapsed="false" class="collapse"><i class="icon-chevron-up"></i></a>
          </div>
        </div>
        <div class="widget-body">
          <table id="users" class="table table-striped table-bordered dataTable">
            <thead>
            <tr>
              <th>编号</th>
              <th>类型名</th>
              <th></th>
            </tr>
            </thead>
            <tbody>
            {volist name="types" id="vo"}
            <tr>
              <td>{$i}</td>
              <td>{$vo.typename}</td>
              <td>
                <div class="btn-group">
                  <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
                    操作
                    <span class="caret"></span>
                  </a>
                  <ul class="dropdown-menu pull-right">
                    <!--<li><a href="#"><i class="icon-edit"></i>修改</a></li>-->
                    <li><a href="#" data-toggle="modal" data-target="#edit_modal" onclick="fullData('{$vo.tid}','{$vo.typename}')"><i class="icon-edit"></i>修改</a></li>
                    <li><a href="{:url('delete',['id'=>$vo.tid])}"><i class="icon-trash"></i>删除</a></li>
                  </ul>
                </div>
              </td>
            </tr>
            {/volist}
            </tbody>
          </table>
        </div> <!-- /widget-body -->
      </div>
      <!-- /. ROW  -->
      <!-- Button trigger modal -->
      <a type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
        添加
      </a>
      <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <h4 class="modal-title" id="myModalLabel">添加类型信息</h4>
            </div>
            <div class="modal-body">
              <form action="{:url('add')}" method="post" enctype="multipart/form-data">
                <div class="modal-body">
                  类型名称:
                  <input type="text" id="typename" name="typename">
                </div>
                <div class="modal-footer">
                  <input  type="reset" class="btn" value="重置">
                  <input type="submit" class="btn btn-primary" value="保存">
                </div>
              </form>
            </div>

          </div>
        </div>

      </div>
      <footer><p>15110100508陈嘉兴  15110100505金生 15110100527韩冬乐</p></footer>
    </div>
    <!-- /. PAGE INNER  -->

  </div>
  <!-- Example Modal -->





  <!-- Edit Modal -->
  <div id="edit_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">×</button>
          <h3 id="editLabel">修改类型信息</h3>
        </div>
        <div class="modal-body">
          <form method="post" action="{:url('update')}" enctype="multipart/form-data">
            <input type="hidden" name="lid" id="elid">
            <div class="modal-body">
              类型名称:
              <input type="text" name="typename" id="etname">
              <input type="hidden" name="tid" id="etid">
            </div>
            <div class="modal-footer">
              <input  type="reset" class="btn" value="重置">
              <input type="submit" class="btn btn-primary" value="保存">
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
  <script>
      function fullData(tid,typename)
      {
          document.getElementById("etname").value=typename;
          document.getElementById("etid").value=tid;
      }
  </script>
  <!-- /. PAGE WRAPPER  -->
  <!-- /. WRAPPER  -->
  <!-- JS Scripts-->
  <!-- jQuery Js -->
  <script src="__STATIC__/assest/js/jquery-1.10.2.js"></script>
  <!-- Bootstrap Js -->
  <script src="__STATIC__/assest/js/bootstrap.min.js"></script>
  <!-- Metis Menu Js -->
  <script src="__STATIC__/assest/js/jquery.metisMenu.js"></script>
  <!-- DATA TABLE SCRIPTS -->
  <script src="__STATIC__/assest/js/jquery.dataTables.js"></script>
  <script src="__STATIC__/assest/js/dataTables.bootstrap.js"></script>
  <script>
      $(document).ready(function () {
          $('#dataTables-example').dataTable();
      });
  </script>
  <!-- Custom Js -->
  <script src="__STATIC__/assest/js/custom-scripts.js"></script>


</body>
</html>
